//const prefixUrl = "http://localhost:49954/";

function SetCookie(name,value)
{
	var Days = 30;
	var exp = new Date();
	exp.setTime(exp.getTime() + Days*24*60*60*1000);
	document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
	
}


function GetCookie(name)
{
	var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
	if(arr=document.cookie.match(reg))
	{
		return unescape(arr[2]);
	}
	
	else
	{
		return null;
	}
	
}

function DelCookie(name)
{
	var exp = new Date();
	exp.setTime(exp.getTime() - 1);
	var cval=GetCookie(name);
	if(cval!=null)
	{
		document.cookie= name + "="+cval+";expires="+exp.toGMTString();
	}

}

function DeleteAllCookie()
{
	
	var keys = document.cookie.match(/[^ =;]+(?=\=)/g);
	if(keys) {
		for(var i = keys.length; i--;)
		{
			document.cookie = keys[i] + '=0;expires=' + new Date(0).toUTCString();
		}
			
	}
}


//http://www.runoob.com/index.php?id=1&image=awesome.jpg
//调用 getQueryVariable("id") 返回 1。
//调用 getQueryVariable("image") 返回 "awesome.jpg"。
 function GetQueryVariable(variable)
{
       var query = window.location.search.substring(1);
       var vars = query.split("&");
       for (var i=0;i<vars.length;i++) {
		   var pair = vars[i].split("=");
		   if(pair[0] == variable){return pair[1];}
       }
       return(false);
}

//去除两头空格
function RemoveSpace(str)
{
	 return str.replace(/^\s+|\s+$/g,"")
}

function CheckEmpty(obj)
{
	if(typeof obj == "undefined" || obj == null || obj == "")
	{
		return true;
	}
	
	return false;
}


